// 引入 uni-fetch发起请求
import {uniFetch} from './uni-fetch.js'
/**
 *  用户的登录接口
 * @param {Object} 用户携带的账号密码数据
 * @return {Object} {code,data,message}
 */
export const loginApi = (data)=>{
  if (!data.account|| !data.password) return
  return uniFetch({
    url:'/driver/login/account',
    method:'POST',
    data
  })
}
/**
 * 获取用户信息
 */
export const getUserInfoApi = ()=>{
  return uniFetch({
    url:'/driver/users'
  })
}
/**
 * 获取任务信息
 * @param {Object} data {year:string,month:string}
 * @returns 
 */
export const getTaskReportApi = (data)=>{
  return uniFetch({
    url:'/driver/users/taskReport',
    data
  })
}

export const getUserTruckApi = () => {
  return uniFetch({
    url:'/driver/users/truck'
  })
}